using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Dune.Business.Domain.Forum;
using Edge.Common.ComponentModel.Parameters;
using Edge.Common.Services;

namespace Dune.Web.Controls.Ajax
{
    public partial class ThemesHtmlContent : System.Web.UI.UserControl
    {
        [QueryParameter("id", IsRequired = false)]
        public int themeID;

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected override void OnInit(EventArgs e)
        {
            WebParameterAttribute.SetValues(this, Request);
            Theme currentTheme = null;
            if (themeID != 0)
            {
                currentTheme = Locator.GetService<IThemeManager>().Load(themeID);
            }
            if (currentTheme != null && currentTheme.Children!= null)
            {
                gridForum.DataSource = currentTheme.Children;
                gridForum.DataBind();
            }
            base.OnInit(e);
            base.OnPreRender(e);
        }
    }
}